package longrise.phone.com.lyredioplayer;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import longrise.phone.com.vediocamaerlib.MyVideoActivity;
import manager.RecordHelper;
import manager.RecordViewManager;

public class MainActivity extends Activity implements RecordViewManager.recordOver , RecordHelper.onPlayStartListener,RecordHelper.onPlayFinishListener {
    private RecordViewManager recordManager;
    private Button bt_play;
    private Button bt_vedio;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button bt_record = (Button)findViewById(R.id.bt_record);
        bt_play = (Button) findViewById(R.id.bt_play);
        bt_vedio = (Button) findViewById(R.id.bt_vedio);
        if (recordManager == null) {
            recordManager = new RecordViewManager(this, bt_record, bt_play);
            recordManager.setMyRecordOver(this);
            recordManager.setOpenAnim(false);
            RecordHelper instance = RecordHelper.getInstance(getApplicationContext());
            instance.setOnPlayFinishListener(this);
        }
        bt_vedio.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                MainActivity.this.startActivity(new Intent(MainActivity.this,MyVideoActivity.class));
            }
        });
    }
    @Override
    public void onRecordOver() {

    }

    @Override
    public void playStart() {

    }

    @Override
    public void playFinish() {

    }
}
